package com.ncsc.lmis.model;
// Generated Feb 25, 2014 11:44:39 PM by Hibernate Tools 3.4.0.CR1


import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

/**
 * SysUserLogin generated by hbm2java
 */
@Entity
@Table(name="sys_user_login"
    ,catalog="lmis"
    , uniqueConstraints = @UniqueConstraint(columnNames="USER_NAME") 
)
public class SysUserLogin  implements java.io.Serializable {


     private Short userNo;
     private SysOrg sysOrg;
     private HrEmp hrEmp;
     private SysUserRole sysUserRole;
     private String userName;
     private String userPassword;
     private String userDescr;
     private String cuser;
     private Set<SysUserRole> sysUserRoles = new HashSet<SysUserRole>(0);
     private Set<SysOrg> sysOrgs = new HashSet<SysOrg>(0);
     private Set<SysUserAppCompPrivilege> sysUserAppCompPrivileges = new HashSet<SysUserAppCompPrivilege>(0);

    public SysUserLogin() {
    }

    public SysUserLogin(SysOrg sysOrg, HrEmp hrEmp, SysUserRole sysUserRole, String userName, String userPassword, String userDescr, String cuser, Set<SysUserRole> sysUserRoles, Set<SysOrg> sysOrgs, Set<SysUserAppCompPrivilege> sysUserAppCompPrivileges) {
       this.sysOrg = sysOrg;
       this.hrEmp = hrEmp;
       this.sysUserRole = sysUserRole;
       this.userName = userName;
       this.userPassword = userPassword;
       this.userDescr = userDescr;
       this.cuser = cuser;
       this.sysUserRoles = sysUserRoles;
       this.sysOrgs = sysOrgs;
       this.sysUserAppCompPrivileges = sysUserAppCompPrivileges;
    }
   
     @Id @GeneratedValue(strategy=IDENTITY)

    
    @Column(name="USER_NO", unique=true, nullable=false)
    public Short getUserNo() {
        return this.userNo;
    }
    
    public void setUserNo(Short userNo) {
        this.userNo = userNo;
    }

@ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="LOGIN_ORG_NO")
    public SysOrg getSysOrg() {
        return this.sysOrg;
    }
    
    public void setSysOrg(SysOrg sysOrg) {
        this.sysOrg = sysOrg;
    }

@ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="USER_EMP_NO")
    public HrEmp getHrEmp() {
        return this.hrEmp;
    }
    
    public void setHrEmp(HrEmp hrEmp) {
        this.hrEmp = hrEmp;
    }

@ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="LOGIN_ROLE_NO")
    public SysUserRole getSysUserRole() {
        return this.sysUserRole;
    }
    
    public void setSysUserRole(SysUserRole sysUserRole) {
        this.sysUserRole = sysUserRole;
    }

    
    @Column(name="USER_NAME", unique=true, length=50)
    public String getUserName() {
        return this.userName;
    }
    
    public void setUserName(String userName) {
        this.userName = userName;
    }

    
    @Column(name="USER_PASSWORD", length=50)
    public String getUserPassword() {
        return this.userPassword;
    }
    
    public void setUserPassword(String userPassword) {
        this.userPassword = userPassword;
    }

    
    @Column(name="USER_DESCR", length=100)
    public String getUserDescr() {
        return this.userDescr;
    }
    
    public void setUserDescr(String userDescr) {
        this.userDescr = userDescr;
    }

    
    @Column(name="CUSER", length=50)
    public String getCuser() {
        return this.cuser;
    }
    
    public void setCuser(String cuser) {
        this.cuser = cuser;
    }

@ManyToMany(fetch=FetchType.LAZY)
    @JoinTable(name="sys_user_login_role", catalog="lmis", joinColumns = { 
        @JoinColumn(name="USER_NO", nullable=false, updatable=false) }, inverseJoinColumns = { 
        @JoinColumn(name="ROLE_NO", nullable=false, updatable=false) })
    public Set<SysUserRole> getSysUserRoles() {
        return this.sysUserRoles;
    }
    
    public void setSysUserRoles(Set<SysUserRole> sysUserRoles) {
        this.sysUserRoles = sysUserRoles;
    }

@ManyToMany(fetch=FetchType.LAZY)
    @JoinTable(name="sys_user_login_org", catalog="lmis", joinColumns = { 
        @JoinColumn(name="USER_NO", nullable=false, updatable=false) }, inverseJoinColumns = { 
        @JoinColumn(name="ORG_NO", nullable=false, updatable=false) })
    public Set<SysOrg> getSysOrgs() {
        return this.sysOrgs;
    }
    
    public void setSysOrgs(Set<SysOrg> sysOrgs) {
        this.sysOrgs = sysOrgs;
    }

@OneToMany(fetch=FetchType.LAZY, mappedBy="sysUserLogin")
    public Set<SysUserAppCompPrivilege> getSysUserAppCompPrivileges() {
        return this.sysUserAppCompPrivileges;
    }
    
    public void setSysUserAppCompPrivileges(Set<SysUserAppCompPrivilege> sysUserAppCompPrivileges) {
        this.sysUserAppCompPrivileges = sysUserAppCompPrivileges;
    }




}


